ostree.git
11 years agoDisplay bytes/second during pull
James Antill [Fri, 25 Jul 2014 06:10:53 +0000 (02:10 -0400)]
Display bytes/second during pull

Add start time to the AsyncProgress object, use it in the common
progress.

11 years agopull: override max-conns-per-host to 8, for faster downloads
James Antill [Fri, 25 Jul 2014 14:08:02 +0000 (10:08 -0400)]
pull: override max-conns-per-host to 8, for faster downloads

Modern web browsers are all converging on 6 or 8.  Let's match that.

11 years agorefs: Don't try searching for input strings that can't be objects
Colin Walters [Wed, 23 Jul 2014 19:09:24 +0000 (15:09 -0400)]
refs: Don't try searching for input strings that can't be objects

I noticed OSTree was a bit slower, did some investigation
and saw we were enumerating all objects for things like

$ ostree rev-parse blah

Since "blah" can never be an object (because of the 'l' and 'h'), just
return no matches.

11 years agopull-local: Write detached metadata into the correct repository
Colin Walters [Tue, 22 Jul 2014 19:42:56 +0000 (15:42 -0400)]
pull-local: Write detached metadata into the correct repository

We want to write to the dest repo, not src.

Noticed while reviewing this code for some other bug.

https://bugzilla.gnome.org/show_bug.cgi?id=733579

11 years agorepofile: Avoid segfault if querying child in non-directory
Colin Walters [Mon, 21 Jul 2014 02:32:39 +0000 (22:32 -0400)]
repofile: Avoid segfault if querying child in non-directory

The user might "ostree ls /usr/bin/bash/blah", which previously would
segfault.

A somewhat related future enhancement here would be for "ostree ls" to
follow symbolic links.

Reported-by: Dusty Mabe <dustymabe@gmail.com>
https://bugzilla.gnome.org/show_bug.cgi?id=733476

11 years agocore: Do enumerate ff/ objects as well
Colin Walters [Sun, 20 Jul 2014 16:20:51 +0000 (12:20 -0400)]
core: Do enumerate ff/ objects as well

An embarassing off-by-one here.  I noticed we weren't pruning them.

https://bugzilla.gnome.org/show_bug.cgi?id=733458

11 years agocore: Do enumerate content objects in archive-z2 repositories
Colin Walters [Sun, 20 Jul 2014 16:18:09 +0000 (12:18 -0400)]
core: Do enumerate content objects in archive-z2 repositories

Prune has worked fine on bare repositories for some time, but now that
I finally try to delete data on the server side, I notice we weren't
actually enumerating content objects =/

That caused them to not be pruned.

https://bugzilla.gnome.org/show_bug.cgi?id=733458

11 years agocore: Unify object deletion code with prune
Colin Walters [Sun, 20 Jul 2014 12:35:58 +0000 (08:35 -0400)]
core: Unify object deletion code with prune

The prune API duplicated logic to delete objects, and furthermore the
core API to delete an object didn't clean up detached metadata.

Fix the duplication by doing the obvious thing: prune should call
_delete.

https://bugzilla.gnome.org/show_bug.cgi?id=733452

11 years agoFix typo in previous commit
Colin Walters [Fri, 18 Jul 2014 19:49:40 +0000 (15:49 -0400)]
Fix typo in previous commit

11 years agoostree-repo-resolve-rev: Add function to accept a partial checksum
Anne LoVerso [Fri, 11 Jul 2014 18:00:45 +0000 (14:00 -0400)]
ostree-repo-resolve-rev: Add function to accept a partial checksum

This patch adds a function that will parse a partial checksum when
resolving a refspec.  If the inputted refspec matches a truncated
existing checksum, it will return that checksum to be parsed.  If
multiple truncated checksums match the partial refspec, it is not
unique and will return false.  This addition is inspired by the same
functionality in Docker, which allows a user to reference a specific
commit without typing the entire checksum.

partial checksums: Add function to abstract comparison

This modifies the list_objects and list_objects_at functions
to take an additional argument for the string that a commit starts
with.  If this string arg is not null, it will only list commit
objects beginning with that string.  This allows for a new function
ostree_repo_list_commit_objects_starting_with to pass a partial string
and return a list of all matching commits.  This improves on the
previous strategy of listing refs because it will list all commit objects,
even ones in past history.  This update also includes bugfixes on
error handling and string comparison, and changes the output structure
of resolve_partial_checksum. The new strcuture will no longer return FALSE
without error.  Also, the hashtable foreach now uses iter.  Also
includes modified test file

11 years agocore: Use ostree_commit_get_parent in ostree_repo_resolve_rev
James Antill [Fri, 18 Jul 2014 04:01:31 +0000 (00:01 -0400)]
core: Use ostree_commit_get_parent in ostree_repo_resolve_rev

11 years agoostree-remount: mount a tmpfs on /var if necessary so /var is read-write
Owen W. Taylor [Wed, 9 Jul 2014 23:07:38 +0000 (19:07 -0400)]
ostree-remount: mount a tmpfs on /var if necessary so /var is read-write

/var needs to be read-write for a functioning system. Various
systemd services will fail to start if /var is read-only. After we
remount /var (or if we skip remounting /var because / is read-only),
if /var is still readonly, mount a tmpfs file system on /var.

While this isn't strictly part of ostree, keeping it here makes sense
because it keeps twiddling around with the /var mount in one place
for easier coordination and maintenance. This will likely need updating
if systemd gains better support for a readonly root filesystem.

https://bugzilla.gnome.org/show_bug.cgi?id=732979

11 years agopull: Only set ca path if we actually have a setting for it
Colin Walters [Tue, 1 Jul 2014 12:50:05 +0000 (08:50 -0400)]
pull: Only set ca path if we actually have a setting for it

Otherwise, GTlsFileDatabase ends up accepting NULL for anchors, and
then we don't trust any CAs at all.

https://bugzilla.gnome.org/show_bug.cgi?id=726256

11 years agocore: add "tls-ca-path" option
Colin Walters [Thu, 26 Jun 2014 23:39:26 +0000 (19:39 -0400)]
core: add "tls-ca-path" option

Some organizations will want to use private Certificate Authorities to
serve content to their clients.  While it's possible to add the CA
to the system-wide CA store, that has two drawbacks:

1) Compromise of that cert means it can be used for other web traffic
2) All of ca-certificates is trusted

This patch allows a much stronger scenario where *only* the CAs in
tls-ca-path are used for verification from the given repository.

https://bugzilla.gnome.org/show_bug.cgi?id=726256

11 years agoAdd --enable-libsoup-client-certs
Colin Walters [Thu, 26 Jun 2014 11:54:41 +0000 (07:54 -0400)]
Add --enable-libsoup-client-certs

The goal of this is to hard-fail if the API isn't present in the
buildroot, as some downstreams may explicitly require it.

11 years ago[trivial]: Update .gitignore
Colin Walters [Tue, 24 Jun 2014 12:32:22 +0000 (08:32 -0400)]
[trivial]: Update .gitignore

11 years agomanpage: Add separate manpages for each command
Anne LoVerso [Tue, 17 Jun 2014 19:24:08 +0000 (15:24 -0400)]
manpage: Add separate manpages for each command

Using docker as a model, this update creates separate manpages
for each OSTree command, such that the main manpage is not
cluttered and the separate pages can provide more in-depth detail
and exanples that might be useful to a user.  Each page includes
synopsis, description, example, and a list of options if needd.
This update also alphabetizes the usage error output for ostree
and ostree admin so that it matches the list on the manpage.

11 years ago[staticanalysis]: Delete an unused variable
Colin Walters [Sat, 21 Jun 2014 21:36:23 +0000 (17:36 -0400)]
[staticanalysis]: Delete an unused variable

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Fix in_status_line
Colin Walters [Sat, 21 Jun 2014 21:35:03 +0000 (17:35 -0400)]
[staticanalysis]: Fix in_status_line

We need to end the status line *after* we've done a pull, as ostree
admin upgrade does.  Also add the correct in_status_line assignment.

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Fix some dead code
Colin Walters [Sat, 21 Jun 2014 21:34:20 +0000 (17:34 -0400)]
[staticanalysis]: Fix some dead code

One was an unused variable, the other is actually dead because we
can't have mfile != NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Actually check errors on splice() of objects
Colin Walters [Sat, 21 Jun 2014 21:30:11 +0000 (17:30 -0400)]
[staticanalysis]: Actually check errors on splice() of objects

We were using unsigned size when we should have been using signed,
this means we basically weren't checking for errors on write...ouch.

Luckily if we e.g. hit ENOSPC during a pull, the checksums wouldn't
match and we'd return an error anyways.  However when writing an
object, we'd end up silently ignoring it =/

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Add assertion to pacify analyzer
Colin Walters [Sat, 21 Jun 2014 21:28:54 +0000 (17:28 -0400)]
[staticanalysis]: Add assertion to pacify analyzer

This condition can't actually be hit, let's hint that's the case.

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Add missing va_end()
Colin Walters [Sat, 21 Jun 2014 21:24:06 +0000 (17:24 -0400)]
[staticanalysis]: Add missing va_end()

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Fix two uses of uninitialized variables
Colin Walters [Sat, 21 Jun 2014 21:22:55 +0000 (17:22 -0400)]
[staticanalysis]: Fix two uses of uninitialized variables

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years agopackaging: BR e2p
Colin Walters [Sat, 21 Jun 2014 20:55:36 +0000 (16:55 -0400)]
packaging: BR e2p

11 years agoremote: Minor argument parsing cleanup
Colin Walters [Sat, 21 Jun 2014 16:11:56 +0000 (12:11 -0400)]
remote: Minor argument parsing cleanup

Only access relevant portion of argv after we've verified argc.

https://bugzilla.gnome.org/show_bug.cgi?id=731984

11 years agoremote: Fix regression in previous commit wrt adding branches
Colin Walters [Sat, 21 Jun 2014 16:10:24 +0000 (12:10 -0400)]
remote: Fix regression in previous commit wrt adding branches

branches is always NULL at that point, we want to look at argc.

https://bugzilla.gnome.org/show_bug.cgi?id=731984

11 years agolibostree: Add ostree_repo_remote_add() API, port "ostree remote add"
Colin Walters [Fri, 20 Jun 2014 08:58:31 +0000 (04:58 -0400)]
libostree: Add ostree_repo_remote_add() API, port "ostree remote add"

At least one external tool is using the API, and wants to add a
remote, but all of the logic right now is in the tool.  Move it to the
library.

https://bugzilla.gnome.org/show_bug.cgi?id=731984

11 years agotests: Add a test for an empty /etc directory gaining content
Colin Walters [Thu, 19 Jun 2014 19:53:20 +0000 (15:53 -0400)]
tests: Add a test for an empty /etc directory gaining content

https://bugzilla.gnome.org/show_bug.cgi?id=731924

11 years agodoc: Update overview a bit
Colin Walters [Fri, 20 Jun 2014 15:59:49 +0000 (11:59 -0400)]
doc: Update overview a bit

Link to docker, note in introductory paragraph the goal of package
composition on a server.

11 years agodoc: adapting-existing: Update story on latest /usr/lib/passwd bits
Colin Walters [Fri, 20 Jun 2014 14:13:33 +0000 (10:13 -0400)]
doc: adapting-existing: Update story on latest /usr/lib/passwd bits

11 years agodoc: No need to emphasize the poweroff vs other OSes so much
Colin Walters [Fri, 20 Jun 2014 14:13:09 +0000 (10:13 -0400)]
doc: No need to emphasize the poweroff vs other OSes so much

11 years agodoc: Update links to Continuous
Colin Walters [Fri, 20 Jun 2014 14:12:53 +0000 (10:12 -0400)]
doc: Update links to Continuous

11 years agodocs: overview: Explicitly call out dpkg/rpm
Colin Walters [Fri, 20 Jun 2014 14:11:42 +0000 (10:11 -0400)]
docs: overview: Explicitly call out dpkg/rpm

To be more clear that we don't handle "inventory".

11 years agopull: Emit a better error if the remote isn't found
Colin Walters [Fri, 6 Jun 2014 20:17:05 +0000 (16:17 -0400)]
pull: Emit a better error if the remote isn't found

The generic GKeyFile error isn't quite informative enough here.

I hit this with the new compose process where we don't automatically
inject a configured remote into the generated disk images; we expect
people to add them.

https://bugzilla.gnome.org/show_bug.cgi?id=731346

11 years agotests: Add a test which exercises --fsync=false
Colin Walters [Wed, 18 Jun 2014 22:24:41 +0000 (18:24 -0400)]
tests: Add a test which exercises --fsync=false

11 years agocore: Fix g_file_get_uri/get_parse_name for non-root ostree files
James Antill [Wed, 18 Jun 2014 06:57:19 +0000 (02:57 -0400)]
core: Fix g_file_get_uri/get_parse_name for non-root ostree files

11 years agocommit: Hide --disable-fsync option, add --fsync which takes a boolean
James Antill [Tue, 10 Jun 2014 05:44:10 +0000 (01:44 -0400)]
commit: Hide --disable-fsync option, add --fsync which takes a boolean

Per discussion on mailing list, the --disable-fsync has a
double-negative thing going on; --fsync=false is clearer.

11 years agocat: Fix a typo in usage error printout
Anne LoVerso [Fri, 6 Jun 2014 14:54:05 +0000 (10:54 -0400)]
cat: Fix a typo in usage error printout

11 years agopull: Support --mirror option
Colin Walters [Mon, 16 Jun 2014 21:11:50 +0000 (17:11 -0400)]
pull: Support --mirror option

There's several use cases for calling into ostree itself to do
mirroring, instead of using bare rsync.  For example, it's a bit more
efficient as it doesn't require syncing the objects/ directory.

https://bugzilla.gnome.org/show_bug.cgi?id=728351

11 years agolog: Print a friendly error if we haven't downloaded the complete history
Colin Walters [Wed, 11 Jun 2014 20:40:50 +0000 (16:40 -0400)]
log: Print a friendly error if we haven't downloaded the complete history

For the local repository on the system, it's not the usual case to
have the complete compose history.  Rather than erroring out, provide
a bit more friendly message.

https://bugzilla.gnome.org/show_bug.cgi?id=731538

11 years agoRelease 2014.5
Colin Walters [Mon, 9 Jun 2014 22:39:14 +0000 (18:39 -0400)]
Release 2014.5

11 years agolibostree: Silently ignore EPERM when setting EXT2_IMMUTABLE_FL
Colin Walters [Wed, 4 Jun 2014 22:21:32 +0000 (18:21 -0400)]
libostree: Silently ignore EPERM when setting EXT2_IMMUTABLE_FL

In the case of running ostree as non-root on a regular filesystem (not
tmpfs which doesn't support immutable), we should just silently do
nothing if we encounter EPERM.  Cache the result to avoid spam in
strace.

https://bugzilla.gnome.org/show_bug.cgi?id=728006

11 years agolibostree: Make OstreeFetcher explicitly private
Colin Walters [Sun, 8 Jun 2014 12:04:46 +0000 (08:04 -0400)]
libostree: Make OstreeFetcher explicitly private

Per previous commit.  We're not attempting to export an HTTP to
clients, the high level API is ostree_repo_pull().

https://bugzilla.gnome.org/show_bug.cgi?id=731369

11 years agolibostree: Make OstreeTlsCertInteraction explicitly private
Colin Walters [Sun, 8 Jun 2014 11:58:12 +0000 (07:58 -0400)]
libostree: Make OstreeTlsCertInteraction explicitly private

Similar to previous commit, this should be private.

https://bugzilla.gnome.org/show_bug.cgi?id=731369

11 years agolibostree: Make OstreeLibarchiveInputStream explicitly private
Colin Walters [Sun, 8 Jun 2014 11:56:14 +0000 (07:56 -0400)]
libostree: Make OstreeLibarchiveInputStream explicitly private

We weren't installing the headers, but at the moment all symbols
starting with ostree_ were being exported.  Fix that by prefixing
non-static symbols with '_'.

https://bugzilla.gnome.org/show_bug.cgi?id=731369

11 years agorepo: Support fsync=false configuration
Colin Walters [Wed, 4 Jun 2014 13:59:47 +0000 (09:59 -0400)]
repo: Support fsync=false configuration

See rationale in the updated docs.  Basically developer use cases as
well as UPS-backed servers.

11 years agoHonor disable_fsync during checkout also
Vadim Rutkovsky [Tue, 3 Jun 2014 23:40:32 +0000 (01:40 +0200)]
Honor disable_fsync during checkout also

Finally, fsync to ensure all entries are on disk, unless disabled.
 We support disabling this for cases like server-side buildroot
 construction where we don't need to be robust against power loss

11 years agoostree-remount: Check for / being *mounted* read-only, not necessarily writable
Colin Walters [Tue, 3 Jun 2014 21:38:00 +0000 (17:38 -0400)]
ostree-remount: Check for / being *mounted* read-only, not necessarily writable

The previous S_IMMUTABLE commit broke ostree-remount; / is now not
actually writable.  All we really wanted to know though was whether it
was *mounted* writable, so check that via statvfs() which is cleaner
anyways (i.e. not via access() which kernel people hate).

https://bugzilla.gnome.org/show_bug.cgi?id=728006

11 years agoAdd --disable-fsync option to both commit and pull (non-local)
James Antill [Mon, 2 Jun 2014 20:31:58 +0000 (16:31 -0400)]
Add --disable-fsync option to both commit and pull (non-local)

On some storage configurations, fsync() can be extremely expensive.
Developers and users with slow hard drives may want the ability to opt
for speed over safety.

Furthermore, many production servers have UPS and stable kernels, and
the risk of not fsync'ing in that scenario is fairly low.  These users
should also be able to opt out.

11 years agodeploy: Set the immutable bit on the deployment root
Colin Walters [Fri, 30 May 2014 14:02:01 +0000 (10:02 -0400)]
deploy: Set the immutable bit on the deployment root

This prevents people from creating new directories there and expecting
them to be persisted.  The OSTree model has all local state to be in
/etc and /var.

This introduces a compile-time dependency on libe2fsprogs.

We're only doing this for the root directory at the moment.

https://bugzilla.gnome.org/show_bug.cgi?id=728006

11 years agoMove Makefile.dist-packaging under packaging/
Colin Walters [Mon, 2 Jun 2014 19:27:40 +0000 (15:27 -0400)]
Move Makefile.dist-packaging under packaging/

11 years agoLimit metadata to 10 MiB
Colin Walters [Fri, 25 Apr 2014 19:14:42 +0000 (15:14 -0400)]
Limit metadata to 10 MiB

If fetching GPG-signed commits over plain HTTP, a MitM attacker can
fill up the drive of targets by simply returning an enormous stream
for the commit object.

Related to this, an attacker can also cause OSTree to perform large
memory allocations by returning enormous GVariants in the metadata.

This helps close that attack by limiting all metadata objects to 10
MiB, so the initial fetch will be truncated.

But now the attack is only slightly more difficult as the attacker
will have to return a correctly formed commit object, then return a
large stream of < 10 MiB dirmeta/dirtree objects.

https://bugzilla.gnome.org/show_bug.cgi?id=725921

11 years agofetcher: Unref pending result when completing
Colin Walters [Tue, 27 May 2014 15:57:45 +0000 (11:57 -0400)]
fetcher: Unref pending result when completing

Otherwise we were just leaking it.

https://bugzilla.gnome.org/show_bug.cgi?id=725921

11 years agorepo: Don't require a txn for writing
Colin Walters [Mon, 26 May 2014 22:32:17 +0000 (18:32 -0400)]
repo: Don't require a txn for writing

The current "transaction" symlink was introduced to fix issues with
interrupted pulls; normally we assume that if we have a metadata
object, we also have all objects to which it refers.

There used to be a "summary" which had all the available refs, but I
deleted it because it wasn't really used, and was still racy despite
the transaction bits.

We still want the pull process to use the transaction link, so don't
delete the APIs, just relax the restriction on object writing, and
introduce a new ostree_repo_set_ref_immediate().

11 years agorepo: Only load /etc/ostree/remotes.d for system repo
Colin Walters [Mon, 26 May 2014 22:36:03 +0000 (18:36 -0400)]
repo: Only load /etc/ostree/remotes.d for system repo

They shouldn't be loaded for random test/personal repositories.  Doing
so triggers another bug in that we return them from
ostree_repo_get_config() when then causes clients to write them out
permanently to disk with ostree_repo_write_config().  This caused test
suite failures.

11 years agotrivial: commit: Fix docstring typos
Colin Walters [Mon, 26 May 2014 21:57:09 +0000 (17:57 -0400)]
trivial: commit: Fix docstring typos

11 years agodeploy: Convert remaining g_print() to systemd journal messages
Colin Walters [Sat, 24 May 2014 17:19:29 +0000 (13:19 -0400)]
deploy: Convert remaining g_print() to systemd journal messages

These bits should be logged more sanely.

11 years agodeploy: Remove deployment root print
Colin Walters [Sat, 24 May 2014 16:30:56 +0000 (12:30 -0400)]
deploy: Remove deployment root print

It doesn't look very professional; in the future though we should have
a progress bar here or something.

11 years agotrivial: TODO: Add link sizes/progress bar
Colin Walters [Fri, 23 May 2014 11:59:35 +0000 (07:59 -0400)]
trivial: TODO: Add link sizes/progress bar

11 years agotrivial: TODO: Add link for http unprivileged
Colin Walters [Fri, 23 May 2014 11:57:23 +0000 (07:57 -0400)]
trivial: TODO: Add link for http unprivileged

11 years agopackaging: BR libgsystem
Colin Walters [Thu, 22 May 2014 23:53:54 +0000 (19:53 -0400)]
packaging: BR libgsystem

11 years agoselinux-ensure-labeled: Support no arguments to just traverse deployment root
Colin Walters [Thu, 22 May 2014 23:24:39 +0000 (19:24 -0400)]
selinux-ensure-labeled: Support no arguments to just traverse deployment root

This makes it easy to use for the case where rpm-ostree-toolbox is
injecting systemd services into the deployment root, and we don't
actually need to traverse the whole FS.

11 years agoadmin switch: Allow switching just remote names
Colin Walters [Thu, 15 May 2014 12:58:44 +0000 (08:58 -0400)]
admin switch: Allow switching just remote names

This is a followup to the previous commit; for the installation media
case we want to keep the current origin ref, and only switch remotes.

11 years agoadmin switch: Support switching remotes as well
Colin Walters [Mon, 12 May 2014 20:57:46 +0000 (16:57 -0400)]
admin switch: Support switching remotes as well

Say I have an installation from CDROM; the remote name may be
"installmedia" or something like that.  We want to allow also
switching remotes.

11 years agobuild: Add missing DESTDIR
Colin Walters [Fri, 9 May 2014 13:06:59 +0000 (09:06 -0400)]
build: Add missing DESTDIR

Hooray for read-only bind mounts and building as non-root.

11 years agoSupport /etc/ostree/remotes.d
Colin Walters [Thu, 8 May 2014 13:16:36 +0000 (09:16 -0400)]
Support /etc/ostree/remotes.d

For many OS install scenarios, one runs through an installer which may
come with embedded data, and then the OS is configured post-install to
receive updates.

In this model, it'd be nice to avoid the post-install having to rewrite
the /ostree/repo/config file.

Additionally, it feels weird for admins to interact with "/ostree" -
let's make the system feel more like Unix and have our important
configuration in /etc.

https://bugzilla.gnome.org/show_bug.cgi?id=729343

11 years agotrivial-httpd: flush after writing the port to stdout
Owen W. Taylor [Mon, 5 May 2014 22:58:01 +0000 (18:58 -0400)]
trivial-httpd: flush after writing the port to stdout

The option --port-file=- is most useful when the stdout of the daemon
is programatically redirected and not going to a terminal. The
flush-after-a-line behavior of stdout is specific to terminals, so
we need an explicit flush.

https://bugzilla.gnome.org/show_bug.cgi?id=729609

11 years agopull: Add tls-client-cert-{path,key} (if we have new enough libsoup)
Colin Walters [Thu, 1 May 2014 16:55:13 +0000 (12:55 -0400)]
pull: Add tls-client-cert-{path,key} (if we have new enough libsoup)

This is an actually working version of client-side certificates.
Depends on:
See: https://bugzilla.gnome.org/show_bug.cgi?id=334021

We detect whether libsoup is new enough for this.

https://bugzilla.gnome.org/show_bug.cgi?id=729356

11 years agoRevert "pull: Add tls-client-cert-{path,key}"
Colin Walters [Thu, 1 May 2014 14:23:11 +0000 (10:23 -0400)]
Revert "pull: Add tls-client-cert-{path,key}"

This reverts commit 94f9ee7bcedaf29ed3d84aacaada50aac7644415.
Doesn't actually work, see
https://bugzilla.gnome.org/show_bug.cgi?id=334021

11 years agopull: Add tls-client-cert-{path,key}
Colin Walters [Thu, 1 May 2014 11:57:06 +0000 (07:57 -0400)]
pull: Add tls-client-cert-{path,key}

These can be used to present a client certificate when making requests
to a repository.

11 years agopull: Correctly handle error state when fetching optional data
Colin Walters [Tue, 29 Apr 2014 13:02:43 +0000 (09:02 -0400)]
pull: Correctly handle error state when fetching optional data

For the static deltas work, we're using the already-extant internal
API to perform a HTTP fetch for optional data - static deltas are
optional.

Except that we didn't correctly unset the error if we were doing an
optional fetch and the data wasn't found.

11 years agopull: Stay in mainloop if we're synchronously fetching URI
Colin Walters [Tue, 29 Apr 2014 13:00:21 +0000 (09:00 -0400)]
pull: Stay in mainloop if we're synchronously fetching URI

The static deltas work will be doing some synchronous fetching even
after refs are downloaded.

11 years agodeltas: Link to liblzma, add internal API to use it
Colin Walters [Tue, 29 Apr 2014 12:56:05 +0000 (08:56 -0400)]
deltas: Link to liblzma, add internal API to use it

For future static deltas work, we'll be linking to liblzma.  Since
it's fairly widespread, let's just make it a hard dependency.

11 years agolibostree: Add _finish() API to async progress
Colin Walters [Tue, 29 Apr 2014 12:54:39 +0000 (08:54 -0400)]
libostree: Add _finish() API to async progress

Since OstreeAsyncProgress queues to the mainloop, we might "lose" the
last message.  Give callers a way to force a flush.

11 years agootutil: Correctly add ref to bytes when creating GVariant
Colin Walters [Tue, 29 Apr 2014 12:53:28 +0000 (08:53 -0400)]
otutil: Correctly add ref to bytes when creating GVariant

This one went undiscovered for a while because it turned out we
weren't using it...

11 years agocore: Add _STRING variants of GVariant object formats
Colin Walters [Sun, 27 Apr 2014 20:32:17 +0000 (16:32 -0400)]
core: Add _STRING variants of GVariant object formats

For the static deltas work, we're going to embed a commit in the delta
superblock, so we need a format string without the G_VARIANT_TYPE().

11 years agoshow: Fix segfault if we can't find an object
Colin Walters [Sun, 27 Apr 2014 20:31:50 +0000 (16:31 -0400)]
show: Fix segfault if we can't find an object

We need to use the original rev here.

11 years agolibotutil: Fix two bugs in usage of posix_fallocate()
Colin Walters [Tue, 29 Apr 2014 11:40:25 +0000 (07:40 -0400)]
libotutil: Fix two bugs in usage of posix_fallocate()

* It's invalid to call it with a size of 0, so don't do that.

* posix_* apparently don't set errno.  So capture the return value and
  use that.

11 years agocore: Use posix_fallocate() when writing objects
Colin Walters [Mon, 28 Apr 2014 23:42:12 +0000 (19:42 -0400)]
core: Use posix_fallocate() when writing objects

This helps ensure the filesystem allocates space efficiently.

11 years agoos-init: don't create /var/log/journal on deploy
Cosimo Cecchi [Tue, 22 Apr 2014 22:36:03 +0000 (15:36 -0700)]
os-init: don't create /var/log/journal on deploy

Leave the policy of whether to persistently store journal logs to the
system integrator when the default journald configuration is in use.

https://bugzilla.gnome.org/show_bug.cgi?id=728762

11 years agobuild: Remove --enable-embedded-dependencies
Colin Walters [Tue, 22 Apr 2014 13:08:35 +0000 (09:08 -0400)]
build: Remove --enable-embedded-dependencies

This is going to bitrot too much; we'll figure out a better way to do
this when someone if a RHEL6 port ever happens.  Probably Software
Collections.

11 years agoRelease 2014.4
Colin Walters [Sun, 13 Apr 2014 17:50:27 +0000 (10:50 -0700)]
Release 2014.4

11 years agodeploy: fsync() copy of /etc
Colin Walters [Wed, 9 Apr 2014 00:18:44 +0000 (20:18 -0400)]
deploy: fsync() copy of /etc

This unfortunately requires reimplementing gs_shutil_cp_a(), except
while we're here, we also use the *at calls.

11 years agodeploy: fsync() kernel/initramfs and bootloader config parent directories
Colin Walters [Tue, 8 Apr 2014 22:40:33 +0000 (18:40 -0400)]
deploy: fsync() kernel/initramfs and bootloader config parent directories

Ensure they've hit disk.

11 years agodeploy: fdatasync() bootloader configuration files
Colin Walters [Tue, 8 Apr 2014 22:48:08 +0000 (18:48 -0400)]
deploy: fdatasync() bootloader configuration files

Yet more data we're writing out that needs to be sync'd.

11 years agolibotutil: Make use of dirfd-relative API in ot_gfile_replace_contents_fsync()
Colin Walters [Tue, 8 Apr 2014 22:31:33 +0000 (18:31 -0400)]
libotutil: Make use of dirfd-relative API in ot_gfile_replace_contents_fsync()

It's just more efficient.

11 years agodeploy: Ensure .origin file is fsync()ed on disk
Colin Walters [Tue, 8 Apr 2014 22:21:19 +0000 (18:21 -0400)]
deploy: Ensure .origin file is fsync()ed on disk

Along with its parent directory.

11 years agodeploy: Also fsync parent directory of modified config files
Colin Walters [Tue, 8 Apr 2014 21:41:28 +0000 (17:41 -0400)]
deploy: Also fsync parent directory of modified config files

11 years agodeploy: Ensure that any modified config files are fsync()d
Colin Walters [Tue, 8 Apr 2014 21:37:35 +0000 (17:37 -0400)]
deploy: Ensure that any modified config files are fsync()d

It really wouldn't do for one to be missing one's ssh keys for
example...

11 years agocheckout: fsync() directory on checkouts
Colin Walters [Tue, 8 Apr 2014 21:31:17 +0000 (17:31 -0400)]
checkout: fsync() directory on checkouts

We want to be really sure that our deployment roots have hit the disk.

11 years agodeploy: Ensure that all directories we create are fsync()d
Colin Walters [Tue, 8 Apr 2014 21:24:07 +0000 (17:24 -0400)]
deploy: Ensure that all directories we create are fsync()d

There's two halves to this; first, when we create an hierarchy, we
need to call fsync().  Second, we need to fsync again anytime after
we've modified a directory.

11 years agolibotutil: Add API to create directory hierarchy recursively *and* fsync
Colin Walters [Tue, 8 Apr 2014 21:22:38 +0000 (17:22 -0400)]
libotutil: Add API to create directory hierarchy recursively *and* fsync

To be really sure that any directory entries have hit disk we need to
call fsync() on the directory fd.  This API allows us to conveniently
create a directory hierarchy, fsyncing all of it along the way.

11 years agopull: Display download progress of individual objects as we get it
Colin Walters [Fri, 11 Apr 2014 05:31:14 +0000 (01:31 -0400)]
pull: Display download progress of individual objects as we get it

It was kind of annoying at least for rpm-ostree upgrades since /boot
happens to be first and we eat a 21MB initramfs with no download
progress.

https://bugzilla.gnome.org/show_bug.cgi?id=726348

11 years agolibotutil: Fix mistaken return of TRUE in error path
Colin Walters [Tue, 8 Apr 2014 22:15:52 +0000 (18:15 -0400)]
libotutil: Fix mistaken return of TRUE in error path

Gah, must have been a refactoring bug.

12 years agoUse external libgsystem 2014.2
Colin Walters [Fri, 4 Apr 2014 20:52:36 +0000 (16:52 -0400)]
Use external libgsystem 2014.2

It's been split off for a while, let's kill the code duplication.

Among other things, this fixes the systemd detection for the journal
logging.

12 years agoswitch: Always allow chronological downgrades
Colin Walters [Fri, 4 Apr 2014 20:51:37 +0000 (16:51 -0400)]
switch: Always allow chronological downgrades

Ideally we'd have something a bit more strict, but...without
downloading the parentage, this is all we can do at the moment.

12 years agodeploy: Call fsync() on parent directory before/after symlink swap
Colin Walters [Fri, 4 Apr 2014 02:39:41 +0000 (22:39 -0400)]
deploy: Call fsync() on parent directory before/after symlink swap

Let's be conservative here and try hard to ensure the symlink has the
correct content on disk.

12 years agobootloader: fdatasync() bootloader configuration
Colin Walters [Fri, 4 Apr 2014 02:20:59 +0000 (22:20 -0400)]
bootloader: fdatasync() bootloader configuration

Let's be a bit more conservative here and actually fdatasync() the
configurations we're generating.

I'm seeing an issue at the moment where syslinux isn't finding the
config sometimes, and while I don't think this is the issue, let's try
it.

12 years agobootloaders: Always write out bootloader config file
Colin Walters [Fri, 4 Apr 2014 01:08:03 +0000 (21:08 -0400)]
bootloaders: Always write out bootloader config file

There was an attempted optimization to only write if changed, but this
is broken - we always write the bootloader config into a new
directory.

In theory we should only be writing if it changed, but let's not do a
broken optimization.